#ifndef QCREGISTRY_H
#define QCREGISTRY_H

#include "qclogger.h"
#include <QSharedPointer>

namespace QcLog {

namespace Details {

class QcRegistry
{
public:
    QcRegistry(const QcRegistry &) = delete;
    QcRegistry &operator=(const QcRegistry &) = delete;

    inline static QcRegistry &instance()
    {
        static QcRegistry s_instance;
        return s_instance;
    }

    inline QcLogger *get_default_raw()
    {
        return default_logger_.data();
    }

private:
    inline QcRegistry()
    {
        default_logger_ = QSharedPointer<QcLogger>(new QcLogger);
    }
    ~QcRegistry() = default;

    QSharedPointer<QcLogger> default_logger_;
};

} //namespace Details

} //namespace QcLog

#endif // QCREGISTRY_H
